package com.study.servlet.cookie.prac02;

import java.util.HashMap;
import java.util.Map;

import com.study.servlet.cookie.prac02.domain.Book;

public class BookDB {

	public static Map<String, Book> books = new HashMap<String, Book>();
	
	static {

		books.put("1", new Book(1, "金瓶梅", "王学进", 5, "古典爱情小说"));
		books.put("2", new Book(2, "葵花宝典", "张德强", 5, "欲练此功，必须练好基本功"));
		books.put("3", new Book(3, "辟邪剑法", "蒋海龙", 5, "欲练此功，必须练好基本功"));
		books.put("4", new Book(4, "玉女心经", "刘梅双", 10, "男子不要练"));
		books.put("5", new Book(5, "厚脸皮是什么炼成的", "李慧声", 5, "不要练小说"));

	}

	public static Map<String, Book> getAllBooks() {
		return books;
	}

	public static Book getBookById(String key) {
		return books.get(key);
	}
	
}
